
import rsaMod, pickle
from functions import *
print "Generate keys for P2PMSG"
username = raw_input("username= ")
bitrate = int(raw_input("bitrate= "))

# GENERATE KEYS
(encryptKey, decryptKey) = rsaMod.gen_pubpriv_keys(bitrate)

# SHOW THE KEYS
print "encryptKey = "+str(encryptKey)
print "decryptKey = "+ str(decryptKey)

print "TESTING THE KEYS NOW"

# WRITE KEY TO FILE
f = open("keys/"+username+".decrypt", "w")
f.write(dictToTags(decryptKey))
f.close()

f = open("keys/"+username+".encrypt", "w")
f.write(dictToTags(encryptKey))
f.close()

print "THE KEYS ARE GENERATED"



